home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / NET.422 < prev    next >
Text File  |  1993-02-20  |  8KB  |  258 lines

  1. VBBS type mod......
  2. Altair #1 @14259
  3. Mon Feb 15 17:57:05 1993
  4. 2[4Status2] :1 No Reply Necessary. 
  5.  
  6. ==============================================================================
  7.                   NET.MOD
  8.  
  9. List NET CALLS after the last few callers like VBBS does!
  10. Revised for 4.22 by,
  11. Altair 1 @14259 LINK 1 @4259 NET
  12. Mon Febuary 15, 10:00 am 1993
  13. Dificulty Easy....
  14. Version: 422 and most others as long as
  15.      they are running NET 32. With the right modification
  16.      this mod will work with NET 31 also.
  17.  
  18.    Let me stress that the idea for this mod is originally not mine.
  19.    I just added things here and there to make it work a little nicer.
  20.  
  21. ==============================================================================
  22.  
  23. OkAY Ever noticed how when you log on to a BBS running the VBBS software, and
  24. there has been a net connection recently, it displays the network's name
  25. after the "Last Few Callers" section?  Well, I kinda like that.  I thought
  26. "Hey, why can't we do that with WWIV?"  The most obvious problem is that
  27. the writes to NET.LOG are made by the network software, NOT by WWIV.
  28. Therefore, one would have to modify the network software to get it to do
  29. it then.  Well, instead of that, what this mod does is a tad more difficult.
  30. When the BBS notices it's a network connection <usernum==-2> it runs the
  31. network program.  AFTER that, it does a tiny bit of processing.  <Cleaning
  32. up from the network, re-initializing the modem, etc>  Well, I figured, "Why
  33. not read the NET.LOG file, find out what the last connection was, and then
  34. write it to the LASTON1.TXT and USER1.LOG files?"  That's what I did.
  35.  
  36.  
  37. Anyway, as it's written this mod will ONLY work for NET32, as it uses certain
  38. info the way NET 32 writes it to the log.
  39. With minor modification it can work on 4.21 and lower.
  40.  
  41. > I added a few things to this mode like, color and the name of the last
  42. >   network connected to along with it's phone number.
  43. >   All credit for this mode must still go to the
  44. >   original Author Galen Pathwarden #1 @17303
  45.  
  46.  
  47. FILES AFFECTED:  LILO.C
  48.          NETSUP.C
  49.          BBS.C
  50.          SYSOPF.C
  51.          FCNS.H
  52.  
  53. KEY: +++ add line
  54.      === Look for line
  55.      --- Delete Line
  56.      ??? Modifiy Line
  57.  
  58.  
  59. STEP ONE: BACK UP YOUR SOURCE!  I am not responsible for ANY damage caused
  60. to your source, data files, or computer as a result of this mod.  It has been
  61. tested on my system and has caused no problems.
  62.  
  63.  
  64. STEP TWO: Load LILO.C
  65. Scan down for VOID GETUSER.  A little ways down, it will have the stuff
  66. with NETWORK.EXE, REMOTE.EXE, etc.  A tiny bit below that, add this section
  67. of code:
  68.  
  69. ===              get_status();
  70. ===              if (l!=status.qscanptr) {
  71. ===                for (i=0; i<num_subs; i++) {
  72. ===                  sub_dates[i]=0L;
  73. ===                }
  74. ===              }
  75. +++              if (usernum==-2)
  76. +++                add_net_to_log();
  77. ===              hangup=1;
  78. ===              dtr(0);
  79. ===              global_xx=0;
  80.  
  81.  
  82.  while still in LILO.C  in void logon(); search down for this section of code
  83.  and add the additions. this will also make your last few callers print in color.
  84.  (Delete your laston.txt and user.log in the gfiles directory)
  85.  Because of the new format for these files.......
  86.  
  87. ===    pl(s1);
  88. ===  }
  89. ===  while (pos<len);
  90. ===  }
  91. +++ printfile("LASTON1.TXT");
  92. === nl();
  93. === if ((actsl!=255) || (incom)) {
  94. ===   sl1(0,"");
  95. ===   sl1(0,s);
  96. ===   sl1(1,"");
  97. ???   sprintf(s,"4[3%ld4]1: 2%-34s  1%s  5%s  7%s - %d\r\n",
  98. ===          status.callernum1,
  99. ===          nam(&thisuser,usernum),
  100. ???          times(),
  101. ???          date(),
  102. ===          curspeed,
  103. ===          thisuser.ontoday);
  104.  
  105.  
  106. STEP THREE: Save LILO.C, and load NETSUP.C
  107. Add this entire void at the bottom.
  108.  
  109.  
  110. void add_net_to_log(void)
  111. {
  112.    int nn,sn,i,i1,f;
  113.    char s[81],s1[81],s2[81],*ss;
  114.    FILE *fil;
  115.    long len,pos;
  116.    net_system_list_rec *csne;
  117.  
  118.    sprintf(s,"%sNET.LOG",syscfg.gfilesdir);
  119.    if ((fil=fopen(s,"rt"))==NULL)
  120.      return;
  121.    fgets(s1,22,fil);    /* change to 24 for NET 31 and below */
  122.    fgets(s1,6,fil);
  123.    if (s1[strlen(s1)]==',')
  124.      s1[strlen(s1)]=0;
  125.    sn=atoi(s1);
  126.    fclose(fil);
  127.    for (nn=0; nn<net_num_max; nn++) {
  128.      set_net_num(nn);
  129.      if (!net_sysnum)
  130.        continue;
  131.      if (!net_networks[net_num].con)
  132.        read_call_out_list();
  133.      i=-1;
  134.      for (i1=0; i1<net_networks[net_num].num_con; i1++) {
  135.        if (net_networks[net_num].con[i1].sysnum == sn) {
  136.      i=i1;
  137.      break;
  138.        }
  139.      }
  140.      if (i==i1)
  141.        break;
  142.    }
  143.    if (i==-1)
  144.      return;
  145.    strcpy(s1,net_networks[net_num].name);
  146.    csne=next_system(sn);
  147.    sprintf(s,"5%-4s: 2@3%-6d1%-25s 2%s  7%s\r\n",
  148.                    s1,   /* Net Name */
  149.                    sn,   /* Node Connected */
  150.                    csne->name,
  151.                    csne->phone,
  152.                    times());
  153.    pl(s);
  154.    sprintf(s2,"%sLASTON1.TXT",syscfg.gfilesdir);      /* Makes a file named LASTON1.TXT in G-files directory */
  155.    ss=get_file(s2,&len);
  156.    sprintf(s1,"%sUSER1.LOG",syscfg.gfilesdir);        /* Makes a file named USER1.LOG in G-files directory */
  157.    f=open(s1,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE);
  158.    lseek(f,0L,SEEK_END);
  159.    i=strlen(s);
  160.    write(f,(void *)s,i);
  161.    close(f);
  162.    f=open(s2,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
  163.    pos=0;
  164.    copy_line(s1,ss,&pos,len);
  165.    for (i=1; i<4; i++) {
  166.      copy_line(s1,ss,&pos,len);
  167.      strcat(s1,"\r\n");
  168.      write(f,(void *)s1,strlen(s1));
  169.    }
  170.    write(f,(void *)s,strlen(s));
  171.    close(f);
  172. }
  173.  
  174.  
  175.  
  176. STEP FOUR: Save NETSUP.C, load FCNS.H
  177. add to end of NETSUP.C the void you just put in.
  178.  
  179.  
  180. /* File: netsup.c */
  181.  
  182. Add this line:
  183.  
  184. === void print_pending_list(void);
  185. +++ void add_net_to_log(void);
  186.  
  187.  
  188.  
  189. STEP FIVE: Save FCNS.H, COMPILE!
  190.  
  191. STEP SIX: Wait for a network call to come in, and check the laston1.txt and
  192. you'll see the network's name and the node listed, along with the Name of
  193. the board, the Phone number, and time!  WOW!
  194.  
  195. STEP SEVEN: open BBS.C This part is your option!!
  196.         you don't have to do this for the mod to work.
  197.         What this will do is make a /L option from the
  198.         main menu that will show the total Network connects
  199.         for the day.
  200.  
  201.  
  202. search for void mainmenu(void) and look for:
  203.  
  204. === if (strcmp(s,"/Z")==0) {
  205. ===   pl(get_string(26));
  206. ===   set_x_only(1, "POSTS.TXT", 0);
  207. ===   nscan(0);
  208. ===   set_x_only(0, NULL, 0);
  209. ===   add_arc("OFFLINE", "POSTS.TXT", 0);
  210. ===   download_temp_arc("OFFLINE", 0);
  211. ===  }
  212. +++ if (strcmp(s,"/L")==0) {
  213. +++   nl();
  214. +++   prt(1,"Network Connects");
  215. +++   printfile("USER1.LOG");
  216. +++ }
  217. === if (strcmp(s,"NET")==0)
  218. ===   print_net_listing(0);
  219.  
  220.   also remember to edit your menus so that the option will
  221.   be shown.............
  222.  
  223.  
  224.  
  225. STEP EIGHT: Load up SYSOPF.C and search for void beginday(void)
  226.         What this does is at midnight every day it will delete
  227.         the file USER1.LOG so you don't end up with just one
  228.         large file.
  229.         Then Look for this section of code and add what is below.
  230.  
  231.  
  232. ===  sprintf(s,"%s%s",syscfg.gfilesdir, ststus.log2);
  233. ===  unlink(s);
  234.  
  235. ===  sprintf(s,"%sUSER.LOG",syscfg.gfilesdir);
  236. ===  unlink(s)
  237.  
  238. +++  sprintf(s"%sUSER1.LOG",syscfg.gfilesdir);
  239. +++  unlink(s);
  240. ===  save_status();
  241. ===  sprintf(s,"%sZLOG.DAT",syscfg.datadir);
  242.  
  243.  
  244.   That's it for SYSOPF.C close it up and recompile the BBS.
  245.  
  246. STEP NINE: Send email if you have any problems with this.
  247.  
  248.  
  249. You can contact me at:
  250.     WWIVNET : 1@4259
  251.     WWIVLink: 1@14259
  252.  
  253. Or, call my BBS
  254.       Into The Night
  255.       (412)758-2456
  256.       300-2400 baud
  257.       24 Hours........
  258.